﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class CommercialDistrict : District
{
    public CommercialDistrict(City city)
        : base(DistrictType.Commercial, city)
    {
    }


    protected override bool IsCompleteDistrict(Dictionary<Building.BuildingType, int> typesInDistrict)
    {
        bool hasBank = typesInDistrict.ContainsKey(Building.BuildingType.Banks);
        bool hasRestaurant = typesInDistrict.ContainsKey(Building.BuildingType.Restaurants);
        bool hasBigBoxStore = typesInDistrict.ContainsKey(Building.BuildingType.BigBoxStore);
        bool hasBusinessPark = typesInDistrict.ContainsKey(Building.BuildingType.BusinessPark);
        bool hasTheater = typesInDistrict.ContainsKey(Building.BuildingType.Theater);

        return hasBank && hasRestaurant && hasBigBoxStore && hasBusinessPark && hasTheater;
    }

    protected override bool IsValidBuildingType(Building.BuildingType buildingType)
    {
        if (buildingType == Building.BuildingType.Banks) return true;
        if (buildingType == Building.BuildingType.Restaurants) return true;
        if (buildingType == Building.BuildingType.BigBoxStore) return true;
        if (buildingType == Building.BuildingType.BusinessPark) return true;
        if (buildingType == Building.BuildingType.Theater) return true;

        return false;
    }

    protected override float GetDistrictScore(List<Building> buildings)
    {
        return 20;
    }
}
